public abstract class ManagerService {

    protected CinemaSystem system;

    protected ManagerService(CinemaSystem system) {
        this.system = system;
    }

    /**
     * 管理方法
     */
    public void manage() {
        boolean flag = true;

        while (flag) {
            showMenu();
            int choice = Main.sc.nextInt();
            Main.sc.nextLine(); // 清除缓冲区
            switch (choice) {
                case 1:
                    add();
                    break;
                case 2:
                    showList();
                    break;
                case 3:
                    System.out.println("返回上一级");
                    flag = false;
                    break;
                default:
                    System.out.println("无效的选项，请重新选择！");
                    showMenu();
                    break;
            }
        }
    }

    /**
     * 显示管理菜单
     */
    public abstract void showMenu();

    /**
     * 添加数据
     */
    public abstract void add();

    /**
     * 显示数据列表
     */
    public abstract void showList();
}
